package com.only4play.dto;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.util.StringUtils;

/**
 * @author liyuncong
 * @version 1.0
 * @file PersonLoginDto
 * @brief 用户登录对象
 * @details 用户登录对象
 * @date 2024-02-21
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                     NAME               DESCRIPTION
 * 2024-02-21               liyuncong          Created
 */

@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class PersonLoginDto {
    // 登录名
    private String loginUsername;
    // 登录密码
    private String loginPassword;
    // 验证码
    private String captcha;
    // 验证码key
    private String captchaKey;
    // rsa公钥key
    private String rasKey;


    public boolean validate() {
        return StringUtils.hasText(loginUsername) &&
            StringUtils.hasText(loginPassword) &&
            StringUtils.hasText(captcha) &&
            StringUtils.hasText(captchaKey) &&
            StringUtils.hasText(rasKey);
    }
}
